Lesson 2
My first "Dynamic" rotating cube.

1. Create a game of a 3D application is a simple question of details adding to the software. Take for example, a simple rotating cube. The steps to create it are to firstly create the cube and than make it slowly rotate all the time.



2. Type the following small program in the editing area from DarkBASIC Professional's editor :
	Null = EXT INITIALIZED()
MyCube = B3D MAKE OBJECT CUBE( 100 ) DO YROTATE OBJECT MyCube,OBJECT ANGLE Y(1)+0.1 LOOP
3. This program will make a cube rotate indefinitely and slowly. The command B3D MAKE OBJECT CUBE will create dynamically the cube The commands DO and LOOP make the main demonstration loop and the command YROTATE OBJECT apply a new rotation under Y axis to the cube called "MyCube". You must not forget the function EXT INITIALIZED() because if you don't put it on the beginning of your program, the eXtends plugin will not initialize and you'll probably get an error message saying : "DBProExtends\GetDBProBase init failed" .


CLIC HERE TO GO BACK TO MAIN MENU